<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            position: relative;
            width: 600px;
            height: 320px;
            background-color: pink;
            margin: 0 auto;
        }
        .box img {
            width: 100%;
            height: 100%;
        }
        /* 当鼠标经过盒子，就显示遮罩层 */
        .box:hover::after {
            position: absolute;
            top: 0;
            left: 0;
            content: '';
            display: block;
            width: 600px;
            height: 320px;
            background: rgba(0, 0, 0, .5) url(../../img/play.webp) no-repeat center center;
            /* 设置背景图片的大小 */
            background-size: 50px 50px;
        }
    </style>
</head>
<body>
    <div class="box">
        <img src="../../img/phone.jpg" alt="">
    </div>
</body>
</html>